#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<unordered_map>
using namespace std;

class Solution {
public:
    vector<int> missingTwo(vector<int>& nums) {
        int tmp = 0;
        for (auto& ch : nums) tmp ^= ch;
        for (int i = 1; i <= nums.size() + 2; i++)
        {
            tmp ^= i;
        }
        int a = 0, b = 0;
        int diff = 0;
        while (1)
        {
            if (((tmp >> diff) & 1) == 1) break;
            diff++;
        }
        for (auto& ch : nums)
        {
            if ((ch >> diff) & 1 == 1) a ^= ch;
            else b ^= ch;
        }
        for (int i = 1; i <= nums.size() + 2; i++)
        {
            if ((i >> diff) & 1 == 1) a ^= i;
            else b ^= i;
        }
        return { a,b };
    }
};

int main() {
    return 0;
}